function cellInfo = mavlink_hil_state_t(varargin) 
% MAVLINK_HIL_STATE_T returns a cell array containing bus object information 
% 
% Optional Input: 'false' will suppress a call to Simulink.Bus.cellToObject 
%                 when the MATLAB file is executed. 
% The order of bus element attributes is as follows:
%   ElementName, Dimensions, DataType, SampleTime, Complexity, SamplingMode, DimensionsMode, Min, Max, DocUnits, Description 

suppressObject = false; 
if nargin == 1 && islogical(varargin{1}) && varargin{1} == false 
    suppressObject = true; 
elseif nargin > 1 
    error('Invalid input argument(s) encountered'); 
end 

cellInfo = { ... 
  { ... 
    'mavlink_hil_state_t', ... 
    '', ... 
    '', ... 
    'Auto', ... 
    '-1', {... 
{'time_usec', 1, 'double', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('[us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.')}; ...
{'roll', 1, 'single', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('[rad] Roll angle')}; ...
{'pitch', 1, 'single', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('[rad] Pitch angle')}; ...
{'yaw', 1, 'single', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('[rad] Yaw angle')}; ...
{'rollspeed', 1, 'single', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('[rad/s] Body frame roll / phi angular speed')}; ...
{'pitchspeed', 1, 'single', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('[rad/s] Body frame pitch / theta angular speed')}; ...
{'yawspeed', 1, 'single', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('[rad/s] Body frame yaw / psi angular speed')}; ...
{'lat', 1, 'int32', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('[degE7] Latitude')}; ...
{'lon', 1, 'int32', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('[degE7] Longitude')}; ...
{'alt', 1, 'int32', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('[mm] Altitude')}; ...
{'vx', 1, 'int16', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('[cm/s] Ground X Speed (Latitude)')}; ...
{'vy', 1, 'int16', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('[cm/s] Ground Y Speed (Longitude)')}; ...
{'vz', 1, 'int16', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('[cm/s] Ground Z Speed (Altitude)')}; ...
{'xacc', 1, 'int16', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('[mG] X acceleration')}; ...
{'yacc', 1, 'int16', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('[mG] Y acceleration')}; ...
{'zacc', 1, 'int16', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('[mG] Z acceleration')}; ...
    } ...
  } ...
}'; 

if ~suppressObject 
    % Create bus objects in the MATLAB base workspace 
    Simulink.Bus.cellToObject(cellInfo) 
end 
